package com.gk.study.mapper;

import com.gk.study.entity.TagCountDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;



@Mapper
public interface HomeTypeMapper {
    @Select("SELECT bg.id, bg.title, COUNT(bh.thing_id) AS num FROM b_home bh JOIN b_thing bt ON bh.thing_id = bt.id JOIN b_tag bg ON bt.tag_id = bg.id GROUP BY bg.id, bg.title")
    List<TagCountDTO> list();
}
